package co.com.inventarios.modelo;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Bodega entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "BODEGA", schema = "MANAGER", uniqueConstraints = {})
public class Bodega implements java.io.Serializable {

	// Fields

	private String bodcodigo;
	private Cataventa cataventa;
	private String bodnombre;
	private String bodpadre;
	private Long bodrojos;
	private String bodcorto;
	private Long bodactivo;
	private Long bodtipo;
	private Set<Mngmcn> mngmcns = new HashSet<Mngmcn>(0);
	private Set<Probodega> probodegas = new HashSet<Probodega>(0);
	private Set<Mngdoc> mngdocs = new HashSet<Mngdoc>(0);
	private Set<Dlluser> dllusers = new HashSet<Dlluser>(0);
	private Set<RequiDoc> requiDocs = new HashSet<RequiDoc>(0);
	private Set<Proserie> proseries = new HashSet<Proserie>(0);
	private Dlluser dlluser;
	private Timestamp bodlogfec;
	// Constructors

	/** default constructor */
	public Bodega() {
	}

	/** minimal constructor */
	public Bodega(String bodcodigo, Cataventa cataventa, String bodpadre) {
		this.bodcodigo = bodcodigo;
		this.cataventa = cataventa;
		this.bodpadre = bodpadre;
	}

	/** full constructor */
	public Bodega(String bodcodigo, Cataventa cataventa, String bodnombre,Dlluser dlluser,
			String bodpadre, Long bodrojos, String bodcorto, Long bodactivo,
			Long bodtipo, Set<Mngmcn> mngmcns, Set<Probodega> probodegas,
			Set<Mngdoc> mngdocs, Set<Dlluser> dllusers, Timestamp bodlogfec,
			Set<RequiDoc> requiDocs, Set<Proserie> proseries) {
		this.bodcodigo = bodcodigo;
		this.cataventa = cataventa;
		this.bodnombre = bodnombre;
		this.bodpadre = bodpadre;
		this.bodrojos = bodrojos;
		this.bodcorto = bodcorto;
		this.bodactivo = bodactivo;
		this.bodlogfec = bodlogfec;
		this.bodtipo = bodtipo;
		this.mngmcns = mngmcns;
		this.dlluser = dlluser;
		this.probodegas = probodegas;
		this.mngdocs = mngdocs;
		this.dllusers = dllusers;
		this.requiDocs = requiDocs;
		this.proseries = proseries;
	}

	// Property accessors
	@Id
	@Column(name = "BODCODIGO", unique = true, nullable = false, insertable = true, updatable = true, length = 15)
	public String getBodcodigo() {
		return this.bodcodigo;
	}

	public void setBodcodigo(String bodcodigo) {
		this.bodcodigo = bodcodigo;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "BODCATALOG", unique = false, nullable = false, insertable = true, updatable = true)
	public Cataventa getCataventa() {
		return this.cataventa;
	}

	public void setCataventa(Cataventa cataventa) {
		this.cataventa = cataventa;
	}

	@Column(name = "BODNOMBRE", unique = false, nullable = true, insertable = true, updatable = true, length = 50)
	public String getBodnombre() {
		return this.bodnombre;
	}

	public void setBodnombre(String bodnombre) {
		this.bodnombre = bodnombre;
	}

	@Column(name = "BODPADRE", unique = false, nullable = false, insertable = true, updatable = true, length = 15)
	public String getBodpadre() {
		return this.bodpadre;
	}

	public void setBodpadre(String bodpadre) {
		this.bodpadre = bodpadre;
	}

	@Column(name = "BODROJOS", unique = false, nullable = true, insertable = true, updatable = true, precision = 22, scale = 0)
	public Long getBodrojos() {
		return this.bodrojos;
	}

	public void setBodrojos(Long bodrojos) {
		this.bodrojos = bodrojos;
	}

	@Column(name = "BODCORTO", unique = false, nullable = true, insertable = true, updatable = true, length = 20)
	public String getBodcorto() {
		return this.bodcorto;
	}

	public void setBodcorto(String bodcorto) {
		this.bodcorto = bodcorto;
	}

	@Column(name = "BODACTIVO", unique = false, nullable = true, insertable = true, updatable = true, precision = 22, scale = 0)
	public Long getBodactivo() {
		return this.bodactivo;
	}

	public void setBodactivo(Long bodactivo) {
		this.bodactivo = bodactivo;
	}

	@Column(name = "BODTIPO", unique = false, nullable = true, insertable = true, updatable = true, precision = 22, scale = 0)
	public Long getBodtipo() {
		return this.bodtipo;
	}

	public void setBodtipo(Long bodtipo) {
		this.bodtipo = bodtipo;
	}

	@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "bodega")
	public Set<Mngmcn> getMngmcns() {
		return this.mngmcns;
	}

	public void setMngmcns(Set<Mngmcn> mngmcns) {
		this.mngmcns = mngmcns;
	}

	@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "bodega")
	public Set<Probodega> getProbodegas() {
		return this.probodegas;
	}

	public void setProbodegas(Set<Probodega> probodegas) {
		this.probodegas = probodegas;
	}

	@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "bodega")
	public Set<Mngdoc> getMngdocs() {
		return this.mngdocs;
	}

	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "BODLOGUSER", unique = false, nullable = true, insertable = true, updatable = true)
	public Dlluser getDlluser() {
		return this.dlluser;
	}

	public void setDlluser(Dlluser dlluser) {
		this.dlluser = dlluser;
	}

	@Column(name = "BODLOGFEC", unique = false, nullable = true, insertable = true, updatable = true)
	public Timestamp getBodlogfec() {
		return this.bodlogfec;
	}

	public void setBodlogfec(Timestamp bodlogfec) {
		this.bodlogfec = bodlogfec;
	}
	
	public void setMngdocs(Set<Mngdoc> mngdocs) {
		this.mngdocs = mngdocs;
	}

	@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "bodega")
	public Set<Dlluser> getDllusers() {
		return this.dllusers;
	}

	public void setDllusers(Set<Dlluser> dllusers) {
		this.dllusers = dllusers;
	}

	@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "bodega")
	public Set<RequiDoc> getRequiDocs() {
		return this.requiDocs;
	}

	public void setRequiDocs(Set<RequiDoc> requiDocs) {
		this.requiDocs = requiDocs;
	}

	@OneToMany(cascade = {}, fetch = FetchType.LAZY, mappedBy = "bodega")
	public Set<Proserie> getProseries() {
		return this.proseries;
	}

	public void setProseries(Set<Proserie> proseries) {
		this.proseries = proseries;
	}

}